﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Data;
using Pigmalion.BusinessEntities;

namespace Pigmalion.DataAccess
{
    public partial class CategoriaRepository:MasterDAABRepository,ICategoriaRepository
    {
        public List<Categoria> GetAllFromCategoria()
        {
            var categorias = this.PigmalionDatabase.ExecuteSprocAccessor<Categoria>("GetAllFromCategoria");

            return categorias.ToList();
        }

        public Categoria GetFromCategoriaById(int id)
        {
            var categoria = this.PigmalionDatabase.ExecuteSprocAccessor<Categoria>("GetFromCategoriaById", id);

            return categoria.FirstOrDefault();
        }
    }
}
